Previous Book Contents Book Index Next

Inside Macintosh: Open Transport /
Chapter 3 - Endpoints / Endpoints Reference
Constants and Data Types


The TReply Structure

You use the TReply structure to specify the data being sent with the OTSndReply function (page 3-141) and the data being read with the OTRcvReply function (page 3-144). You pass this structure as a parameter to each of these functions.

The TReply structure is defined by the TReply data type.

struct TReply
   {
      TNetbuf  data;
      TNetbuf  opt;
      OTSequence sequence;
   };
   typedef struct TReply TReply;
Field Description
data
A TNetbuf structure specifying the location and size of the reply buffer.
In the reply parameter to the OTSndReply function, this field specifies the location and size of a buffer containing the reply data. You must allocate and initialize a buffer that contains the data and set the data.buf field to point to it. You must set the data.len field to the size of the reply data. The size of the reply must not exceed the value specified for the tsdu field of the TEndpointInfo structure for this endpoint.
In the reply parameter to the OTRcvReply function, on return, this field specifies the size and location of a buffer into which the function places the data to be read. You must allocate a buffer for this data, set the data.buf field to point to it, and set the data.maxlen field to the maximum size of the buffer. This value must not exceed the value specified for the tsdu field of the TEndpointInfo structure for this endpoint.
If you are doing a no-copy receive, the data.buf field is a pointer to an OTBuffer pointer. In this case, you must set the data.maxlen field to the constant kNetbufDataIsOTBufferStar.
opt
A TNetbuf structure describing the size and location of an option buffer.
In the reply parameter to the OTSndReply function, this field specifies the location and size of a buffer containing the options you want to set. You must allocate a buffer for the option values, set the opt.buf field to point to it, and set the opt.len field to the length of the options or to 0 if don't want to specify any options.
In the reply parameter to the OTRcvReply function, on return, this field specifies the location and size of a buffer containing the association-related options sent with the OTSndReply function. You must allocate a buffer for the option information, set the opt.buf field to point to it, and set the opt.maxlen field to the maximum size of the buffer.
sequence
A long that specifies the transaction ID of the current transaction.
When sending a reply, you set this field to the value that you read with the OTRcvURequest function for this field.
When receiving a reply, if you have sent out multiple requests, you use this field to match incoming replies to outgoing requests.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 AUG 1996